Implements a layout organizing children components in a grid. More...
Public Member Functions | |
GridLayout () | |
~GridLayout () | |
Component * | getComponentAt (unsigned int index) |
virtual void | setParentComponent (Component *parent) override |
void | setGridWidth (unsigned int value) |
void | setGridHeight (unsigned int value) |
void | setFixedSizeRow (unsigned int rowIndex, unsigned int sizePix) |
void | setFixedSizeCol (unsigned int colIndex, unsigned int sizePix) |
void | setInternalBorderWidth (unsigned int valuePix) |
void | setInternalBorderHeight (unsigned int valuePix) |
void | addComponent (Component *component, int x, int y, int width, int height) |
virtual void | removeComponent (Component *component) override |
virtual void | update () override |
virtual void | exportClassToTree (nkExport::Node *rootNode) override |
virtual void | exportComponentsNodeEntry (nkExport::Node *rootNode) override |
virtual void | importClassFromTree (nkExport::Node *rootNode) override |
virtual void | processComponentsNodeEntry (nkExport::Node *rootNode) override |
![]() | |
Layout () | |
virtual | ~Layout () |
Component * | getParentComponent () const |
LAYOUT_TYPE | getType () const |
![]() | |
Exportable () | |
virtual | ~Exportable () |
Implements a layout organizing children components in a grid.
This layout will alter the components size to make them fit within the bounds of the window, as described by its settings.
nkWinUi::GridLayout::GridLayout | ( | ) |
Constructor.
nkWinUi::GridLayout::~GridLayout | ( | ) |
Destructor.
Component* nkWinUi::GridLayout::getComponentAt | ( | unsigned int | index | ) |
index | The wanted component's index. |
|
overridevirtual |
See Layout::setParentComponent().
Reimplemented from nkWinUi::Layout.
void nkWinUi::GridLayout::setGridWidth | ( | unsigned int | value | ) |
Sets the width of the grid to organize children components. This corresponds to the number of cells to use.
value | The width to use. |
void nkWinUi::GridLayout::setGridHeight | ( | unsigned int | value | ) |
Sets the height of the grid to organize children components. This corresponds to the number of cells to use.
value | The height to use. |
void nkWinUi::GridLayout::setFixedSizeRow | ( | unsigned int | rowIndex, |
unsigned int | sizePix | ||
) |
Allows to add a row that will have a fixed size in pixels.
rowIndex | The index of the row having a fixed size. |
sizePix | The size it will have, in pixels. |
void nkWinUi::GridLayout::setFixedSizeCol | ( | unsigned int | colIndex, |
unsigned int | sizePix | ||
) |
Allows to add a column that will have a fixed size in pixels.
colIndex | The index of the row having a fixed size. |
sizePix | The size it will have, in pixels. |
void nkWinUi::GridLayout::setInternalBorderWidth | ( | unsigned int | valuePix | ) |
Sets the border width in between children components.
valuePix | The width, in pixels. |
void nkWinUi::GridLayout::setInternalBorderHeight | ( | unsigned int | valuePix | ) |
Sets the border height in between children components.
valuePix | The height, in pixels. |
void nkWinUi::GridLayout::addComponent | ( | Component * | component, |
int | x, | ||
int | y, | ||
int | width, | ||
int | height | ||
) |
Add a component to this layout, describing its position in the grid.
component | The component to add. |
x | The x origin in the layout's grid. Starts indexing at 0. |
y | The y origin in the layout's grid. Starts indexing at 0. |
width | The width, in cells number, in the grid. |
height | The height, in cells number, in the grid. |
|
overridevirtual |
See Layout::removeComponent().
Implements nkWinUi::Layout.
|
overridevirtual |
See Layout::update().
Implements nkWinUi::Layout.
|
overridevirtual |
See Layout::exportClassToTree().
Reimplemented from nkWinUi::Layout.
|
overridevirtual |
See Layout::exportComponentsNodeEntry().
Reimplemented from nkWinUi::Layout.
|
overridevirtual |
See Layout::importClassFromTree().
Reimplemented from nkWinUi::Layout.
|
overridevirtual |
See Layout::processComponentsNodeEntry().
Reimplemented from nkWinUi::Layout.